package DINHVIETDUONG_Homeword;

import java.util.Scanner;

import org.omg.Messaging.SyncScopeHelper;

public class CaculatorControllers {
	private Entity_2 m_objEntity;
	public CaculatorControllers(Entity_2 objEntity) {
		m_objEntity = objEntity;
	}

	public void CaculatorInfor(Entity_2 objEntity, Models_2 objModel, int iOpt) {
		switch (iOpt) {
		case 1:
			System.out.println("Kết quả phép cộng là:" + objModel.phepcong(objEntity));
			break;
		case 2:
			System.out.println("kết quả phép trừ là:" + objModel.pheptru(objEntity));
			break;
		case 3:
			System.out.println(" Kết quả phép nhân là:" + objModel.phepnhan(objEntity));
			break;
		case 4: {
			if (objEntity.getB() == 0) {
				if (objEntity.getA() == 0) {
					System.out.println("Result of function is undentified");
				} else {
					System.out.println("Cannot divided by zero");
				}
			} else {
				System.out.println(" Kết quả phép chia là" + objModel.phepchia(objEntity));
			}
			;
			break;
		}
		}
	}
}
